﻿
@model etracks.Web.ProjectReadOnlyViewModel

@using (Html.BeginForm("Edit", "Project", FormMethod.Post, new { @class = "form-horizontal" }))
{
    <div class="form-group">
        <h3 class="col-sm-offset-2 col-sm-8">Project</h3>
    </div>

    <div class="form-group">
        <label for="input_name" class="col-sm-2 control-label">Project Name</label>
        <div class="col-sm-8">
            <p class="form-control-static">@Model.Name</p>
        </div>
    </div>

    <div class="form-group">
        <label for="input_name" class="col-sm-2 control-label">Project Alias</label>
        <div class="col-sm-8">
            <p class="form-control-static">@Model.Alias</p>
        </div>
    </div>

    <div class="form-group">
        <label for="input_name" class="col-sm-2 control-label">Project Type</label>
        <div class="col-sm-8">
            <p class="form-control-static">@DataHelper.IfNull(Model.ProjectType)</p>
        </div>
    </div>

    <div class="form-group">
        <label for="input_name" class="col-sm-2 control-label">Environment(s)</label>
        <div class="col-sm-8">
            @if (Model.EnvironmentList.Count > 0)
            {
                foreach (etracks.EntityModels.Environment e in Model.EnvironmentList)
                {
                    <p class="form-control-static">
                        @Html.ActionLink(e.Name, "View", "Environment", new { id = e.Id }, null)
                    </p>
                }
            }
            else
            {
                <p class="form-control-static">
                    None. @Html.ActionLink("Add", "Add", "Environment", new { id = Model.Id }, null)
                </p>
            }
            
        </div>
    </div>

    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-8">
            @Html.ActionLink("Project List", "List", "Project", null, new { @class = "btn btn-default" })
        </div>
    </div>
}